package myjava3d;

import javax.media.j3d.AmbientLight;
import javax.media.j3d.BoundingSphere;
import javax.media.j3d.BranchGroup;
import javax.media.j3d.DirectionalLight;
import javax.vecmath.Color3f;
import javax.vecmath.Point3d;
import javax.vecmath.Vector3f;

public class MyLight {
	BranchGroup bgLight = new BranchGroup();
	
	public MyLight() {
		BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), Double.MAX_VALUE);
	    Color3f lightColour1 = new Color3f(1.0f,0.0f,0.0f);
	    Vector3f lightDir1  = new Vector3f(-1.0f,-1.0f,-1.0f);
	    DirectionalLight light1 = new DirectionalLight(lightColour1, lightDir1);
	    light1.setInfluencingBounds(bounds);


	    Vector3f lightDir2  = new Vector3f(1.0f,1.0f,1.0f);
	    Color3f lightColourum = new Color3f(0.0f,0.0f,0.0f);
	    DirectionalLight light2 = new DirectionalLight(lightColour1, lightDir2);
	    light2.setInfluencingBounds(bounds);

	    AmbientLight umgebung=new AmbientLight(lightColourum);
	    umgebung.setBounds(bounds);
	    bgLight.addChild(light1);
	    bgLight.addChild(light2);
	    bgLight.addChild(umgebung);
	}

	public BranchGroup getBranchGroup() {
		return bgLight;
	}
}
